#!/usr/bin/env bash
STEP=${STEP:-stepA_mal}
case "${wasm_MODE}" in
wasmtime)
    exec wasmtime --dir=./ --dir=../ --dir=/ $(dirname $0)/${STEP:-stepA_mal}.wasm "${@}" ;;
wasmer)
    exec wasmer run --dir=./ --dir=../ --dir=/ $(dirname $0)/${STEP:-stepA_mal}.wasm -- "${@}" ;;
warpy)
    exec warpy --argv --memory-pages 256 $(dirname $0)/${STEP:-stepA_mal}.wasm "${@}" ;;
wax)
    exec wax $(dirname $0)/${STEP:-stepA_mal}.wasm "${@}" ;;
wace_libc)
    exec wace $(dirname $0)/${STEP:-stepA_mal}.wasm "${@}" ;;
wace_fooboot)
    echo >&2 "wace_fooboot mode not yet supported" ;;
node|js|*)
    exec ./run.js $(dirname $0)/${STEP:-stepA_mal}.wasm "${@}" ;;
esac
